#include "Core/Texture.h"

namespace blue {

Texture::Texture(GLuint texID, Vector2i size, int channels, unsigned char *data, const char *name) :
ITexture(name), _texID(texID), _size(size), _channels(channels), _data(data)
{
}

Texture::~Texture()
{
    if(_data) delete[] _data;
    glDeleteTextures(1, &_texID);
}

GLuint Texture::getGLID() const
{
    return _texID;
}

const Vector2i &Texture::getSize() const
{
    return _size;
}

int Texture::getChannels() const
{
    return _channels;
}

unsigned char *Texture::getData() const
{
    return _data;
}

}
